<script setup>
import { reactive,ref } from 'vue';
import {Toast} from 'vant'
const props = defineProps({
    title: String
})
console.log(props,'props');
const shopdata = reactive([
    {
        num: '1',
        price: "2.00",
        desc: "描述信息",
        title: "商品标题",
        tag: "top1",
        mz: '热卖',
        shju: 0
    }, {
        num: '1',
        price: "2.00",
        desc: "描述信息",
        title: "商品标题",
        tag: "top2",
        mz: '热卖',
        shju: 0
    }, {
        num: '1',
        price: "2.00",
        desc: "描述信息",
        title: "商品标题",
        tag: "top3",
        mz: '热卖',
        shju: 0
    }, {
        num: '1',
        price: "2.00",
        desc: "描述信息",
        title: "商品标题",
        tag: "top4",
        mz: '热卖',
        shju: 0
    }, {
        num: '1',
        price: "2.00",
        desc: "描述信息",
        title: "商品标题",
        tag: "top5",
        mz: '热卖',
        shju: 0
    }
])
const count = ref(0);
const loading = ref(false);
const onRefresh = () => {
  setTimeout(() => {
    Toast('刷新成功');
    loading.value = false;
    count.value++;
  }, 1000);
};
const value = ref(1);
</script>
<template v-slot:default="slotProps">
    <!-- <slot v-if="!props.title" name="aa"></slot>
    <div v-else>{{props.title}}</div> -->
    <van-pull-refresh v-model="loading" @refresh="onRefresh">
        <van-card class="ovo" v-for="item in shopdata" :num="item.num" :price="item.price" :desc="item.desc"
            :title="item.title" :tag="item.tag" fixed="true"
            thumb="https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg">
            <template #tags>
                <van-tag plain type="danger">{{ item.mz }}</van-tag>
            </template>
            <template #footer>
                <van-field >
                    <template #input class="input-button">
                        <van-stepper v-model="value" />
                    </template>
                </van-field>
            </template>
        </van-card>
    </van-pull-refresh>

    <!-- <router-view></router-view> -->
</template>
<style scoped>
.goods-card {
    margin: 0;
    background-color: white;
}

.ovo {
    overflow-y: hidden;

}
.input-button{
    display: block;
    float: right;
}
.delete-button {}
</style>